<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * pelamarpendidikan.php
 * @author ranuandra
 *
 * 12 Mar 2012 14:25:47
 *
 * 
 */

class Model_Pelamarpendidikan extends ORM
{
	protected $_belongs_to = array(
		'mstpelamar' 	=> array('model' 	=> 'mstpelamar'),
		'mstpendidikan'	=> array('model'	=> 'mstpendidikan'),
		'mstjurusan'	=> array('model'	=> 'mstjurusan'),
	);
	private $_field = array('mstpelamar_id', 'mstpendidikan_id', 'mstjurusan_id', 'thn_masuk', 'thn_lulus', 'type_pendidikan', 'institusi', 'ipk');
	private $_form = array(
							'mstpelamar_id' 	=> '', 
							'mstpendidikan_id' 	=> '', 
							'mstjurusan_id' 	=> '', 
							'thn_lulus' 		=> '', 
							'type_pendidikan' 	=> '', 
							'institusi' 		=> '',
							'ipk'				=> '',
							'thn_masuk'			=> '',
							);
	
	public function rules()
	{
		return array(
							'mstpelamar_id' => array(
													array('min_length', array(':value', 0)),
												), 
							'mstpendidikan_id' => array(
													array('min_length', array(':value', 0)),
												), 
							'mstjurusan_id' => array(
													array('min_length', array(':value', 0)),
												), 
							'thn_lulus' => array(
													array('min_length', array(':value', 0)),
												), 
							'type_pendidikan' => array(
													array('min_length', array(':value', 0)),
												), 
							'institusi' => array(
													array('min_length', array(':value', 0)),
												),
							'ipk' => array(
													array('min_length', array(':value', 0)),
												),
							'thn_masuk' => array(
													array('min_length', array(':value', 0)),
												),
		
		); 
	}
	
	public function getField()
	{
		return $this->_field;
	}
	
	public function getForm()
	{
		return $this->_form;
	}
	
	public function create_data($values)
	{
	    return $this->values($values, $this->_field)->create();
	}	
}